﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ThousandFunClient
{
    public partial class Fm_ErrorDis : Form
    {
        public Fm_ErrorDis()
        {
            InitializeComponent();
            ColumnHeader cZh = new ColumnHeader();//创建一个列
            cZh.Text = "DataReceive";//列名
            ColumnHeader cCh = new ColumnHeader();
            cCh.Text = "DataReply";
            lv_Main.Columns.AddRange(new ColumnHeader[] { cZh, cCh });//将这两列加入listView1
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.listBox1.Items.Add("dd");
  
        }

        private void button2_Click(object sender, EventArgs e)
        {
            
            for (int i = 0; i < 100; i++)
            {
                lv_Main.View = View.Details;//列的显示模式
                ListViewItem lvi = new ListViewItem(new string[] { "dd",i.ToString()}, -1);
                if(i==3)
                {
                    lvic = lvi;
                }
                lv_Main.Items.Add(lvi);
            }

            //lv_Main.Items.Remove(); , i.ToString()
        }

        private void button3_Click(object sender, EventArgs e)
        {
            lv_Main.Items.Remove(lvic);
        }
        private ListViewItem lvic;

        private List<ListViewItem> lvicg;
    }
}
